<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"
      xmlns:th="http://www.thymeleaf.org"
      layout:decorator="backstage/layout">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=8" />
    <title>参赛球队</title>
</head>

<body>
<div id="content" layout:fragment="content">
<script type="text/javascript" src="../../../admin/js/bootstrap-paginator.js"></script>
<script type="text/javascript" src="../../../admin/ace/js/fuelux/fuelux.spinner.min.js"></script>
<script type="text/javascript" src="../../../admin/ace/js/ace-elements.min.js"></script>
<script type="text/javascript" src="../../../admin/js/competitionTeam.js"></script>
    <div class="box-content">
        <div class="row-fluid sortable">
            <div class="box span12">
                <h3 class="row-fluid header smaller lighter blue">
                   <span class="label label-large label-pink arrowed-right" id="title-span">参赛球队</span>
                </h3>
                
                <h2 class="row-fluid header smaller lighter blue">
                    <a class="btn btn-small btn-success btn-competition-team"
                       data-toggle="modal">参赛球队</a>
                    <a class="btn btn-small btn-success btn-preliminary-contest"
                       data-toggle="modal">预赛赛程</a>
                    <a class="btn btn-small btn-success btn-eliminate-contest"
                       data-toggle="modal">淘汰赛赛程</a>
                </h2>
                
                <h3 class="row-fluid header smaller lighter blue" style="border:none;">
                    <a class="btn btn-small btn-success import-btn"
                       data-toggle="modal">导入比赛球队</a>
                    <a class="btn btn-small btn-success export-btn"
                       data-toggle="modal">生成导入表格</a>
                </h3>
                
                <div class="row-fluid sortable ui-sortable" id="team-div">
                	<input type="hidden" id="seasonId" th:value="${seasonId}"/>
                    <div class="xpclass box span3" th:each="group,var:${competitionGroupList}">
                        <div class="widget-header">
                            <h2>
                                <span th:id="${group.id}" th:text="${group.name}"></span>
                            </h2>
                        </div>
                        <div class="widget-body">
                            <div class="widget-main">
                                <!-- <ul class="team-list" style="width: 260px;">
                                    <li class="rest-list clearfix" th:if="${group.competitionTeamList != null}" th:each="team:${group.competitionTeamList}">
                                       	<strong>序号:</strong>
                                       	<span th:text="${team.number}"></span>
                                           <br/>
                                       	<strong>球队名称:</strong>
                                       	<span tag="dateTimes" th:text="${team.teamName}"></span>
                                    </li>
                                 </ul> -->
                                 <table class="table table-striped table-bordered table-hover competition-team-table team-list" th:id="${group.id}" style="width: 260px;">
	                               		<tr th:if="${group.competitionTeam != null}">
	                               			<td th:text="${group.competitionTeam.number}"></td>
	                               			<td th:text="${group.competitionTeam.teamName}"></td>
	                               		</tr>
	                               		<tr th:if="${group.competitionTeam == null}">
	                               			<td>1</td>
	                               			<td></td>
	                               		</tr>
	                               		
	                               		<tr th:if="${group.competitionTeam2 != null}">
	                               			<td th:text="${group.competitionTeam2.number}"></td>
	                               			<td th:text="${group.competitionTeam2.teamName}"></td>
	                               		</tr>
	                               		<tr th:if="${group.competitionTeam2 == null}">
	                               			<td>2</td>
	                               			<td></td>
	                               		</tr>
	                               		
	                               		<tr th:if="${group.competitionTeam3 != null}">
	                               			<td th:text="${group.competitionTeam3.number}"></td>
	                               			<td th:text="${group.competitionTeam3.teamName}"></td>
	                               		</tr>
	                               		<tr th:if="${group.competitionTeam3 == null}">
	                               			<td>3</td>
	                               			<td></td>
	                               		</tr>
	                               		
	                               		<tr th:if="${group.competitionTeam4 != null}">
	                               			<td th:text="${group.competitionTeam4.number}"></td>
	                               			<td th:text="${group.competitionTeam4.teamName}"></td>
	                               		</tr>
	                               		<tr th:if="${group.competitionTeam4 == null}">
	                               			<td>4</td>
	                               			<td></td>
	                               		</tr>
	                               </table>
							</div>
                                    <!-- </li>
                                 </ul> -->
                            </div>
                        </div>
                    </div>
            </div><!--/span-->
        </div><!--/row-->
    </div>
    
    <div class="container-fluid">
        <div id="import-model" class="modal hide fade in" style="display: none;">
            <div class="modal-header">
                <button class="close" data-dismiss="modal" type="button">×</button>
                <h3>导入参赛球队</h3>
            </div>
            <form class="form-horizontal" style="margin: 0" enctype="multipart/form-data" action="/competitionTeam/importTeam.json" method="post" id="importTeamForm">
                <input type="hidden" name="seasonId" th:value="${seasonId}"/>
                <fieldset>
                    <div class="modal-body">                        
	                    <div class="control-group">
	                        <label class="control-label">文件：</label>
	                        <div class="controls">
	                            <div class="widget-main">
		                        	<input type="file" id="id-input-file" name="file"/>
			                    </div>
	                        </div>
	                      </div>
                    </div>
                    <div class="modal-footer">
                        <div style="display: none"><input type="reset" id="addResult"/></div>
                        <input type="submit" class="btn btn-primary" value="导入"/>
                        <a href="#" class="btn btn-small" data-dismiss="modal">取消</a>
                    </div>
                </fieldset>
            </form>
        </div>
    </div>
</div>
</body>
</html>
